package com.xyazm.inventory.domain.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 扣减商品库存参数
 * @author xuyou
 * @date 2022年05月02日 14:58
 */
@Data
public class DeductProductParam implements Serializable {

    /**
     * 业务线标识
     */
    @ApiModelProperty(value = "业务线标识")
    private Integer businessIdentifier;
    /**
     * 订单ID
     */
    @ApiModelProperty(value = "订单ID")
    private String orderId;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    private String userId;

    /**
     * 卖家ID
     */
    @ApiModelProperty(value = "卖家ID")
    private String sellerId;
    /**
     *  订单条目信息
     */
    @ApiModelProperty(value = "订单条目信息")
    @NotEmpty(message = "订单条目信息不能为空")
    private List<OrderItemParam> orderItemParamList;


    /**
     * 订单条目信息
     */
    @Data
    public static class OrderItemParam implements Serializable {

        private static final long serialVersionUID = 8267460170612816097L;
        /**
         * sku编号
         */
        @ApiModelProperty(value = "sku编号")
        @NotEmpty(message = "sku编号不能为空")
        private String skuCode;
        /**
         * 销售数量
         */
        @ApiModelProperty(value = "销售数量")
        @NotNull(message = "销售数量不能为空")
        private Integer saleQuantity;

    }
}
